package com.mzpai.util;

import org.slf4j.Logger;

/**
 * @create 2019-02-20 19:05
 * @desc 标准化日志格式
 **/
public class LogUtil {

    public static void error(Logger logger, String format, Object... arguments) {
        logger.error( format, arguments );
    }

    public static void error(Logger logger, String msg, Throwable t) {
        logger.error( "exception=" + t.getMessage() + ",,msg1=" + msg + ",,StackTrace=", t );
    }

    public static void error(Logger logger, String msg, String remoteIP, String remoteApp, String url, Throwable t) {
        logger.error( "exception=" + t.getMessage() + ",,msg1=" + msg + ",,remoteIP={},,remoteApp={},,url={},,StackTrace=", remoteIP, remoteApp, url, t );
    }

    public static void error(Logger logger, String msg, String remoteIP, String header, String url, String parameter, Throwable t) {
        logger.error( "exception=" + t.getMessage() + ",,msg1=" + msg + ",,remoteIP={},,header={},,url={},,parameter={},,StackTrace=", remoteIP, header, url,parameter, t );
    }

    public static void error(Logger logger, String error) {
        logger.error( "exception=" + error );
    }

}
